# Maintainer: ImperatorS79 <fevrier.simon@gmail.com>

_realname=stb
pkgbase="mingw-w64-${_realname}"
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=r1943.c9064e3
pkgrel=2
_commit="c9064e317699d2e495f36ba4f9ac037e88ee371a"
pkgdesc="single-file public domain (or MIT licensed) libraries for C/C++"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url="https://github.com/nothings/stb"
license=('public domain' 'MIT')
source=("${_realname}-${_commit}"::"git+https://github.com/nothings/${_realname}#commit=${_commit}")
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/${_realname}-${_commit}"
  printf "r%s.%s" "$(git rev-list --count $_commit)" "$(git rev-parse --short $_commit)"
}

package() {
  cd "${srcdir}/${_realname}-${_commit}"
  mkdir -p ${pkgdir}${MINGW_PREFIX}/include/stb
  install *.h ${pkgdir}${MINGW_PREFIX}/include/stb
  install *.c ${pkgdir}${MINGW_PREFIX}/include/stb
}
